<?php 
/**
 * 商品属性表模型
 */
class GoodsAttrModel extends Model{
	
	public $table = 'goods_attr';
	
	
	/**
	 * 获取附加价格
	 */
	 public function getappPrice($gid,$specId){
	 	$specId = explode(',', $specId);
		$appPrice = 0;
	 	foreach ($specId as $v) {
	 		$appPrice += current($this->field('appendprice')->where("gaid={$v} AND goods_gid={$gid}")->find());
	 	}
		return $appPrice;
		
	 }
	
}

















 ?>